/*
 * @Date: 2022-03-25 11:06:10
 * @LastEditTime: 2022-03-25 15:23:51
 */
// components/navigationBar/navigationBar.js
Component({
  options: {
    multipleSlots: true, // 在组件定义时的选项中启用多slot支持
  },
  /**
   * 组件的属性列表
   */
  properties: {
    isBlack: { type: Boolean, value: true },
  },

  /**
   * 组件的初始数据
   */
  data: {},

  /**
   * 组件的方法列表
   */
  methods: {
    getMenuButtonRect() {
      const { top, right, bottom, width, height } =
        wx.getMenuButtonBoundingClientRect()
      this.setData({
        capsuleTop: top,
        capsuleRight: right,
        capsuleBottom: bottom,
        capsuleWidth: width,
        capsuleHeight: height,
        paddingRight: `calc(100vw - ${right}px)`,
      })
    },
    go2page(e) {
      const { type } = e.currentTarget.dataset
      console.log(type)
      switch (Number(type)) {
        case 0:
          wx.navigateBack()
          break
        case 1:
          wx.$go2('/pages/techingPositions/index/index', false, 'switchTab')
          break
        case 2:
          wx.$go2('/pages/techingPositions/index/index', false, 'switchTab')
          break
      }
    },
  },
})
